'''
Created on 09/09/2012

@author: spandana
'''

from FeatureExtract import lemmafeatureExtract
from tool import FeatureSelection
import os
from tool.joinColumns import *

print " Create POS text file"
# 93.5 => 450 vs 300
#features= featureExtract.Features("../../data/train.csv", "../../data/test.csv","../../data/trainLematizedWords.txt","../../data/testLematizedWords.txt")
features= lemmafeatureExtract.Features("../../data/trainNew.csv", "../../data/test.csv","../../data/trainLematizedObj.txt","../../data/testLematizedObj.txt","../../data/unigramTrainLematizedFeature.txt","../../data/trainNewPOSOBJ.txt","../../data/unigramTrainPOSStopWords.txt","../../data/collocFeatures.p")
features.getFeaturesForLineTest("../../data/unigramTrainStopWords.txt", "../../data/lemmaFeaturesTest.csv",400)
features.getFeaturesForLineTrain("../../data/unigramTrainStopWords.txt", "../../data/lemmaFeaturesTrain.csv",400)
FeatureSelection.featureSelection(700, "../../data/lemmaFeaturesTrain.csv", "../../data/lemmaFeaturesTest.csv", 
                  "../../data/lemmaFeaturesTrain_filtered.csv", "../../data/lemmaFeaturesTest_filtered.csv")

#features.createPOSTestfileFeatures("../../data/unigramTrainStopWords.txt","../../data/testFeatureData.csv")
#features.createPOSTrainfileFeatures("../../data/unigramTrainStopWords.txt","../../data/trainFeatureData.csv")

#features.joinFeatures("../../data/unigramTestLematizedFeature500.csv","../../data/testFeatureData.csv" ,"../../data/testFullFeatureData.csv")
#features.joinFeatures("../../data/unigramTrainLematizedFeature500.csv","../../data/trainFeatureData.csv" ,"../../data/trainFullFeatureData.csv")

#trainFeatureMerge = "../../data/trainFeaturesMerged_number_500.csv"
#testFeatureMerge= "../../data/testFeaturesMerged_number_500.csv"

#createMergedFeaturesFull("../../data/trainFullFeatureData.csv", "../../data/testFullFeatureData.csv", trainFeatureMerge, testFeatureMerge)
#createMergedFeaturesAPart("../../data/trainFullFeatureData.csv", "../../data/testFullFeatureData.csv", trainFeatureMerge, testFeatureMerge)